package com.ruoyi.warning.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.warning.domain.entity.Ipv4Mac;
import com.ruoyi.warning.domain.query.Ipv4MacQuery;
import com.ruoyi.warning.domain.vo.Ipv4MacVO;
import com.ruoyi.warning.mapper.Ipv4MacMapper;
import com.ruoyi.warning.service.IIpv4MacService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenhc
 * @since 2025-04-03
 */
@Service
public class Ipv4MacServiceImpl extends ServiceImpl<Ipv4MacMapper, Ipv4Mac> implements IIpv4MacService {

    @Resource
    private Ipv4MacMapper ipv4MacMapper;
    @Override
    public Object getIpMac(Ipv4MacQuery query) {
        Page<Ipv4Mac> page = PageHelper.startPage(query.getPageNum(),query.getPageSize());
        List<Ipv4MacVO> list =ipv4MacMapper.getIpMac(query);
        TableDataInfo tableDataInfo = new TableDataInfo(list, page.getTotal());
        return tableDataInfo;
    }
}
